<?php
include_once "../lib/DAL/DonVi.php";
class DonViBLL{
    function __construct(){
        
    }
    
    function __destruct(){
        
    }
    
    function setDonViBLL($row){
        $donvi = new DonVi();
        $donvi->setdonvi($row['ma_donvi'],$row['ten_donvi'],$row['sdt_donvi'],$row['email_donvi'],$row['diadiem_donvi'],$row['maloai_donvi']);
        return $donvi;         
    }
    
    public function getListDonVi_Lienket(){
      $result = mysql_query("select * from tbl_donvi WHERE maloai_donvi='ttlk'");
      $arr_donvi= array();
      
      while($row = mysql_fetch_array($result)){
        $arr_donvi[] =  $this->setDonViBLL($row);
      }
      return $arr_donvi;
    }
    
    public function GetlistDonVi(){
        $ex=mysql_query("SELECT * FROM tbl_donvi");
        if($ex){
            while($row=mysql_fetch_array($ex)){
                $ds[]=$this->setDonViBLL($row);
            }
        }
     return $ds;
    }
	

}

?>